/*
 * Title: 救济金发放（The Dole Queue）
 * Author: Yuanshun L
 * Created: 01-Otc-2021
 */

#include<stdio.h>
#include<string.h>

int a[21];

int main() {
    int n,k,m;
    memset(a,0,sizeof(a));
    scanf("%d%d%d",&n,&k,&m);
    int l,r,left=n,count=0,first=1;
    l=0;r=n-1;

    while(left>0){
        int i,j;

        count=0; i = l;
        while(count<k){
            if(a[i%n]==0) count++;
            i++;
        }
        l = (i-1)%n;

        count = 0; j = r;
        while(count<m){
            if(a[j]==0) count++;
            if(j-1<0){
                j=n-1;
            }
            else j--;
        }
        if(j==n-1) r=0;
        else r = ++j;


        if(first) first=0;
        else printf(","); // 从输出第二数据开始在前面增加一个逗号

        if(l==r){
            printf("%3d",l+1);
            a[l] = 1;
            left--;
        }
        else{
            printf("%3d %3d",l+1,r+1);
            a[l] = 1;
            a[r] = 1;
            left -= 2;
        }
    }

    return 0;
}